﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using MvcMall.Core.Contacts.Tasks;
using MvcMall.Portal.Controllers.Menu.ViewModels;

namespace MvcMall.Portal.Controllers.Menu
{
    public class MenuController : CenterBaseController
    {
        private readonly IUserTask _userTask;

        public MenuController(IUserTask  userTask)
        {
            this._userTask = userTask;
        }

        public ActionResult LoadMenu()
        {
            var user = UserTask.GetUser(UserName);
            var model = new UserMenuModel
                            {
                                UserName = user.UserName,
                                StoreName = user.Store == null ? string.Empty : user.Store.StoreName
                            };
            return View("Company", model);
        }
    }
}
